/**
 * 
 */
package common;

import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.stereotype.Service;

/**
 * @author Pan JinWen
 * @time 2016年6月8日下午9:48:49
 */
@Service
public class Crypto
{
	public static Md5PasswordEncoder md5PasswordEncoder;
	static
	{
		md5PasswordEncoder = new Md5PasswordEncoder();
	}

	public static String MD5(String rawPass, String salt, boolean encodeHashAsBase64)
	{
		md5PasswordEncoder.setEncodeHashAsBase64(encodeHashAsBase64);
		return md5PasswordEncoder.encodePassword(rawPass, salt);

	}
}
